package competition.cig.cs478.features;

public class Enemy implements Comparable<Enemy> {
	private int distance;
	private byte type;
	private double xOffset;
	private double yOffset;
	
	public Enemy(int x, int y, byte type) {
		this.distance = Math.abs(x - 11) + Math.abs(y - 11);
		this.type = type;
		this.xOffset = (double) Math.abs(x - 11) / 11.0;
		this.yOffset = (double) Math.abs(y - 11) / 11.0;
	}
	
	/**
	 * @return the xOffset
	 */
	public double getxOffset() {
		return xOffset;
	}

	/**
	 * @return the yOffset
	 */
	public double getyOffset() {
		return yOffset;
	}

	@Override
	public int compareTo(Enemy other) {
		return this.distance - other.distance;
	}
	
	/**
	 * @return the distance
	 */
	public int getDistance() {
		return distance;
	}

	/**
	 * @return the type
	 */
	public byte getType() {
		return type;
	}

}
